Option Explicit On 
Option Strict On

Public Class frmDigitalForm
    Inherits System.Windows.Forms.Form
    Public Shared bUpdate As Boolean       'tells whether citation was changed
    Public Shared iDigitIndex As Integer   'negative = new Form, >0 = collection index
    Public Shared oDigiForm As New DigitalOrderClass
    Private Shared cToptions As New Collection
    Friend WithEvents button_example As System.Windows.Forms.Button 'holds Transfer Option index values
    Private Shared dYear As Decimal        'current year


#Region " Windows Form Designer generated code "

    Public Sub New(ByVal Index As Integer)
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
        bUpdate = False
        iDigitIndex = Index

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents cboxFormat As System.Windows.Forms.ComboBox
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents rdoNumber As System.Windows.Forms.RadioButton
    Friend WithEvents rdoDate As System.Windows.Forms.RadioButton
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents txtVerNum As System.Windows.Forms.TextBox
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents numYear As System.Windows.Forms.NumericUpDown
    Friend WithEvents cboxDay As System.Windows.Forms.ComboBox
    Friend WithEvents cboxMonth As System.Windows.Forms.ComboBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents txtSpec As System.Windows.Forms.TextBox
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents txtASCII As System.Windows.Forms.TextBox
    Friend WithEvents btnEditASCII As System.Windows.Forms.Button
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents txtInfoContent As System.Windows.Forms.TextBox
    Friend WithEvents txtDecompress As System.Windows.Forms.TextBox
    Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents Label14 As System.Windows.Forms.Label
    Friend WithEvents numSize As System.Windows.Forms.NumericUpDown
    Friend WithEvents Label15 As System.Windows.Forms.Label
    Friend WithEvents lboxTransfer As System.Windows.Forms.ListBox
    Friend WithEvents btnAddOption As System.Windows.Forms.Button
    Friend WithEvents btnEditOption As System.Windows.Forms.Button
    Friend WithEvents btnDelOption As System.Windows.Forms.Button
    Friend WithEvents btnOK As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents pnlDate As System.Windows.Forms.Panel
    Friend WithEvents pnlNumber As System.Windows.Forms.Panel
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmDigitalForm))
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.button_example = New System.Windows.Forms.Button
        Me.btnCancel = New System.Windows.Forms.Button
        Me.btnOK = New System.Windows.Forms.Button
        Me.btnDelOption = New System.Windows.Forms.Button
        Me.btnEditOption = New System.Windows.Forms.Button
        Me.btnAddOption = New System.Windows.Forms.Button
        Me.lboxTransfer = New System.Windows.Forms.ListBox
        Me.Label15 = New System.Windows.Forms.Label
        Me.numSize = New System.Windows.Forms.NumericUpDown
        Me.Label14 = New System.Windows.Forms.Label
        Me.txtDecompress = New System.Windows.Forms.TextBox
        Me.Label13 = New System.Windows.Forms.Label
        Me.txtInfoContent = New System.Windows.Forms.TextBox
        Me.Label12 = New System.Windows.Forms.Label
        Me.btnEditASCII = New System.Windows.Forms.Button
        Me.txtASCII = New System.Windows.Forms.TextBox
        Me.Label11 = New System.Windows.Forms.Label
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.txtSpec = New System.Windows.Forms.TextBox
        Me.Label10 = New System.Windows.Forms.Label
        Me.pnlDate = New System.Windows.Forms.Panel
        Me.numYear = New System.Windows.Forms.NumericUpDown
        Me.cboxDay = New System.Windows.Forms.ComboBox
        Me.cboxMonth = New System.Windows.Forms.ComboBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.Label8 = New System.Windows.Forms.Label
        Me.Label9 = New System.Windows.Forms.Label
        Me.Label6 = New System.Windows.Forms.Label
        Me.pnlNumber = New System.Windows.Forms.Panel
        Me.txtVerNum = New System.Windows.Forms.TextBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.Panel3 = New System.Windows.Forms.Panel
        Me.rdoDate = New System.Windows.Forms.RadioButton
        Me.rdoNumber = New System.Windows.Forms.RadioButton
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.cboxFormat = New System.Windows.Forms.ComboBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label1 = New System.Windows.Forms.Label
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.Panel1.SuspendLayout()
        CType(Me.numSize, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Panel2.SuspendLayout()
        Me.pnlDate.SuspendLayout()
        CType(Me.numYear, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.pnlNumber.SuspendLayout()
        Me.Panel3.SuspendLayout()
        Me.SuspendLayout()
        '
        'Panel1
        '
        Me.Panel1.AutoScroll = True
        Me.Panel1.Controls.Add(Me.button_example)
        Me.Panel1.Controls.Add(Me.btnCancel)
        Me.Panel1.Controls.Add(Me.btnOK)
        Me.Panel1.Controls.Add(Me.btnDelOption)
        Me.Panel1.Controls.Add(Me.btnEditOption)
        Me.Panel1.Controls.Add(Me.btnAddOption)
        Me.Panel1.Controls.Add(Me.lboxTransfer)
        Me.Panel1.Controls.Add(Me.Label15)
        Me.Panel1.Controls.Add(Me.numSize)
        Me.Panel1.Controls.Add(Me.Label14)
        Me.Panel1.Controls.Add(Me.txtDecompress)
        Me.Panel1.Controls.Add(Me.Label13)
        Me.Panel1.Controls.Add(Me.txtInfoContent)
        Me.Panel1.Controls.Add(Me.Label12)
        Me.Panel1.Controls.Add(Me.btnEditASCII)
        Me.Panel1.Controls.Add(Me.txtASCII)
        Me.Panel1.Controls.Add(Me.Label11)
        Me.Panel1.Controls.Add(Me.Panel2)
        Me.Panel1.Controls.Add(Me.cboxFormat)
        Me.Panel1.Controls.Add(Me.Label2)
        Me.Panel1.Controls.Add(Me.Label1)
        Me.Panel1.Location = New System.Drawing.Point(0, 0)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(621, 456)
        Me.Panel1.TabIndex = 0
        Me.ToolTip1.SetToolTip(Me.Panel1, "description of the form of the data to be distributed. ")
        '
        'button_example
        '
        Me.button_example.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.button_example.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.button_example.Image = Global.MetaDoc.My.Resources.Resources.app_help_48x48
        Me.button_example.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.button_example.Location = New System.Drawing.Point(499, 12)
        Me.button_example.Name = "button_example"
        Me.button_example.Size = New System.Drawing.Size(110, 48)
        Me.button_example.TabIndex = 22
        Me.button_example.Text = "EXAMPLE"
        Me.button_example.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.button_example.UseVisualStyleBackColor = True
        '
        'btnCancel
        '
        Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnCancel.Image = Global.MetaDoc.My.Resources.Resources.Cancel_16x16
        Me.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnCancel.Location = New System.Drawing.Point(536, 417)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.Size = New System.Drawing.Size(75, 23)
        Me.btnCancel.TabIndex = 21
        Me.btnCancel.Text = "Cancel"
        Me.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnOK
        '
        Me.btnOK.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnOK.Image = Global.MetaDoc.My.Resources.Resources.Ok_16x16
        Me.btnOK.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnOK.Location = New System.Drawing.Point(455, 417)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.Size = New System.Drawing.Size(75, 23)
        Me.btnOK.TabIndex = 20
        Me.btnOK.Text = "OK"
        Me.btnOK.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnDelOption
        '
        Me.btnDelOption.Enabled = False
        Me.btnDelOption.Image = Global.MetaDoc.My.Resources.Resources.file_del_16x16
        Me.btnDelOption.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnDelOption.Location = New System.Drawing.Point(190, 417)
        Me.btnDelOption.Name = "btnDelOption"
        Me.btnDelOption.Size = New System.Drawing.Size(75, 23)
        Me.btnDelOption.TabIndex = 7
        Me.btnDelOption.Text = "Delete"
        '
        'btnEditOption
        '
        Me.btnEditOption.Enabled = False
        Me.btnEditOption.Image = CType(resources.GetObject("btnEditOption.Image"), System.Drawing.Image)
        Me.btnEditOption.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnEditOption.Location = New System.Drawing.Point(109, 417)
        Me.btnEditOption.Name = "btnEditOption"
        Me.btnEditOption.Size = New System.Drawing.Size(75, 23)
        Me.btnEditOption.TabIndex = 6
        Me.btnEditOption.Text = "Edit"
        '
        'btnAddOption
        '
        Me.btnAddOption.Image = Global.MetaDoc.My.Resources.Resources.file_new_16x16
        Me.btnAddOption.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnAddOption.Location = New System.Drawing.Point(28, 417)
        Me.btnAddOption.Name = "btnAddOption"
        Me.btnAddOption.Size = New System.Drawing.Size(75, 23)
        Me.btnAddOption.TabIndex = 5
        Me.btnAddOption.Text = "Add"
        '
        'lboxTransfer
        '
        Me.lboxTransfer.Location = New System.Drawing.Point(15, 355)
        Me.lboxTransfer.Name = "lboxTransfer"
        Me.lboxTransfer.Size = New System.Drawing.Size(250, 56)
        Me.lboxTransfer.TabIndex = 4
        Me.ToolTip1.SetToolTip(Me.lboxTransfer, "the means and media by which a data set is obtained from the distributor. ")
        '
        'Label15
        '
        Me.Label15.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label15.Location = New System.Drawing.Point(12, 329)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(136, 23)
        Me.Label15.TabIndex = 14
        Me.Label15.Text = "Digital Transfer Option"
        Me.ToolTip1.SetToolTip(Me.Label15, "the means and media by which a data set is obtained from the distributor. ")
        '
        'numSize
        '
        Me.numSize.DecimalPlaces = 2
        Me.numSize.Location = New System.Drawing.Point(403, 382)
        Me.numSize.Maximum = New Decimal(New Integer() {1000000, 0, 0, 0})
        Me.numSize.Name = "numSize"
        Me.numSize.Size = New System.Drawing.Size(120, 20)
        Me.numSize.TabIndex = 13
        Me.numSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.ToolTip1.SetToolTip(Me.numSize, "the size, or estimated size, of the transferred data set in megabytes (MB)." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "    " & _
                "Domain: Transfer Size > 0.0")
        '
        'Label14
        '
        Me.Label14.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label14.Location = New System.Drawing.Point(400, 368)
        Me.Label14.Name = "Label14"
        Me.Label14.Size = New System.Drawing.Size(136, 23)
        Me.Label14.TabIndex = 12
        Me.Label14.Text = "Transfer Size (optional)"
        Me.ToolTip1.SetToolTip(Me.Label14, "the size, or estimated size, of the transferred data set in megabytes (MB)." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "    " & _
                "Domain: Transfer Size > 0.0" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10))
        '
        'txtDecompress
        '
        Me.txtDecompress.AcceptsReturn = True
        Me.txtDecompress.Location = New System.Drawing.Point(403, 277)
        Me.txtDecompress.Multiline = True
        Me.txtDecompress.Name = "txtDecompress"
        Me.txtDecompress.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtDecompress.Size = New System.Drawing.Size(208, 88)
        Me.txtDecompress.TabIndex = 11
        Me.txtDecompress.Text = "No compression applied"
        Me.ToolTip1.SetToolTip(Me.txtDecompress, resources.GetString("txtDecompress.ToolTip"))
        '
        'Label13
        '
        Me.Label13.Location = New System.Drawing.Point(400, 251)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(184, 23)
        Me.Label13.TabIndex = 10
        Me.Label13.Text = "File Decompression Technique"
        Me.ToolTip1.SetToolTip(Me.Label13, resources.GetString("Label13.ToolTip"))
        '
        'txtInfoContent
        '
        Me.txtInfoContent.AcceptsReturn = True
        Me.txtInfoContent.Location = New System.Drawing.Point(403, 157)
        Me.txtInfoContent.Multiline = True
        Me.txtInfoContent.Name = "txtInfoContent"
        Me.txtInfoContent.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtInfoContent.Size = New System.Drawing.Size(208, 88)
        Me.txtInfoContent.TabIndex = 9
        Me.ToolTip1.SetToolTip(Me.txtInfoContent, "description of the content of the data encoded in a format. ")
        '
        'Label12
        '
        Me.Label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label12.Location = New System.Drawing.Point(400, 138)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(200, 23)
        Me.Label12.TabIndex = 8
        Me.Label12.Text = "Format Information Content (optional)"
        Me.ToolTip1.SetToolTip(Me.Label12, "description of the content of the data encoded in a format. " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10))
        '
        'btnEditASCII
        '
        Me.btnEditASCII.Image = CType(resources.GetObject("btnEditASCII.Image"), System.Drawing.Image)
        Me.btnEditASCII.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnEditASCII.Location = New System.Drawing.Point(536, 112)
        Me.btnEditASCII.Name = "btnEditASCII"
        Me.btnEditASCII.Size = New System.Drawing.Size(75, 23)
        Me.btnEditASCII.TabIndex = 8
        Me.btnEditASCII.Text = "Edit"
        '
        'txtASCII
        '
        Me.txtASCII.Location = New System.Drawing.Point(403, 86)
        Me.txtASCII.Name = "txtASCII"
        Me.txtASCII.ReadOnly = True
        Me.txtASCII.Size = New System.Drawing.Size(208, 20)
        Me.txtASCII.TabIndex = 5
        Me.txtASCII.TabStop = False
        Me.ToolTip1.SetToolTip(Me.txtASCII, "content and format of ASCII data file")
        '
        'Label11
        '
        Me.Label11.Location = New System.Drawing.Point(400, 64)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(120, 23)
        Me.Label11.TabIndex = 4
        Me.Label11.Text = "ASCII File Structure"
        Me.ToolTip1.SetToolTip(Me.Label11, "content and format of ASCII data file")
        '
        'Panel2
        '
        Me.Panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Panel2.Controls.Add(Me.txtSpec)
        Me.Panel2.Controls.Add(Me.Label10)
        Me.Panel2.Controls.Add(Me.pnlDate)
        Me.Panel2.Controls.Add(Me.pnlNumber)
        Me.Panel2.Controls.Add(Me.Panel3)
        Me.Panel2.Controls.Add(Me.Label4)
        Me.Panel2.Controls.Add(Me.Label3)
        Me.Panel2.Location = New System.Drawing.Point(16, 64)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(376, 248)
        Me.Panel2.TabIndex = 3
        '
        'txtSpec
        '
        Me.txtSpec.Location = New System.Drawing.Point(15, 182)
        Me.txtSpec.Multiline = True
        Me.txtSpec.Name = "txtSpec"
        Me.txtSpec.Size = New System.Drawing.Size(232, 48)
        Me.txtSpec.TabIndex = 6
        Me.ToolTip1.SetToolTip(Me.txtSpec, "name of a subset, profile, or product specification of the format. ")
        '
        'Label10
        '
        Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label10.Location = New System.Drawing.Point(12, 166)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(176, 23)
        Me.Label10.TabIndex = 5
        Me.Label10.Text = "Format Specification (optional)"
        Me.ToolTip1.SetToolTip(Me.Label10, "name of a subset, profile, or product specification of the format. ")
        '
        'pnlDate
        '
        Me.pnlDate.Controls.Add(Me.numYear)
        Me.pnlDate.Controls.Add(Me.cboxDay)
        Me.pnlDate.Controls.Add(Me.cboxMonth)
        Me.pnlDate.Controls.Add(Me.Label7)
        Me.pnlDate.Controls.Add(Me.Label8)
        Me.pnlDate.Controls.Add(Me.Label9)
        Me.pnlDate.Controls.Add(Me.Label6)
        Me.pnlDate.Location = New System.Drawing.Point(192, 23)
        Me.pnlDate.Name = "pnlDate"
        Me.pnlDate.Size = New System.Drawing.Size(168, 129)
        Me.pnlDate.TabIndex = 4
        Me.ToolTip1.SetToolTip(Me.pnlDate, "date of the version of the format. ")
        '
        'numYear
        '
        Me.numYear.Location = New System.Drawing.Point(56, 32)
        Me.numYear.Maximum = New Decimal(New Integer() {2100, 0, 0, 0})
        Me.numYear.Minimum = New Decimal(New Integer() {1900, 0, 0, 0})
        Me.numYear.Name = "numYear"
        Me.numYear.Size = New System.Drawing.Size(96, 20)
        Me.numYear.TabIndex = 9
        Me.numYear.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.numYear.Value = New Decimal(New Integer() {2004, 0, 0, 0})
        '
        'cboxDay
        '
        Me.cboxDay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxDay.Items.AddRange(New Object() {"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"})
        Me.cboxDay.Location = New System.Drawing.Point(56, 96)
        Me.cboxDay.Name = "cboxDay"
        Me.cboxDay.Size = New System.Drawing.Size(96, 21)
        Me.cboxDay.TabIndex = 11
        Me.ToolTip1.SetToolTip(Me.cboxDay, "Optional")
        '
        'cboxMonth
        '
        Me.cboxMonth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxMonth.Items.AddRange(New Object() {"00 Unknown", "01 Jan", "02 Feb", "03 March", "04 April", "05 May", "06 June", "07 July", "08 August", "09 Sept", "10 Oct", "11 Nov", "12 Dec"})
        Me.cboxMonth.Location = New System.Drawing.Point(56, 64)
        Me.cboxMonth.Name = "cboxMonth"
        Me.cboxMonth.Size = New System.Drawing.Size(96, 21)
        Me.cboxMonth.TabIndex = 10
        Me.ToolTip1.SetToolTip(Me.cboxMonth, "Optional")
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(8, 96)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(48, 16)
        Me.Label7.TabIndex = 8
        Me.Label7.Text = "Day"
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(8, 64)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(48, 16)
        Me.Label8.TabIndex = 7
        Me.Label8.Text = "Month"
        '
        'Label9
        '
        Me.Label9.Location = New System.Drawing.Point(8, 32)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(40, 16)
        Me.Label9.TabIndex = 6
        Me.Label9.Text = "Year"
        '
        'Label6
        '
        Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label6.Location = New System.Drawing.Point(8, 8)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(100, 23)
        Me.Label6.TabIndex = 0
        Me.Label6.Text = "Version Date"
        Me.ToolTip1.SetToolTip(Me.Label6, "date of the version of the format. ")
        '
        'pnlNumber
        '
        Me.pnlNumber.Controls.Add(Me.txtVerNum)
        Me.pnlNumber.Controls.Add(Me.Label5)
        Me.pnlNumber.Location = New System.Drawing.Point(15, 96)
        Me.pnlNumber.Name = "pnlNumber"
        Me.pnlNumber.Size = New System.Drawing.Size(157, 56)
        Me.pnlNumber.TabIndex = 3
        '
        'txtVerNum
        '
        Me.txtVerNum.Location = New System.Drawing.Point(8, 24)
        Me.txtVerNum.Name = "txtVerNum"
        Me.txtVerNum.Size = New System.Drawing.Size(128, 20)
        Me.txtVerNum.TabIndex = 1
        Me.txtVerNum.Text = "version number of the format. "
        Me.ToolTip1.SetToolTip(Me.txtVerNum, "version number of the format. ")
        '
        'Label5
        '
        Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label5.Location = New System.Drawing.Point(8, 8)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(100, 23)
        Me.Label5.TabIndex = 0
        Me.Label5.Text = "Version Number"
        Me.ToolTip1.SetToolTip(Me.Label5, "version number of the format. ")
        '
        'Panel3
        '
        Me.Panel3.Controls.Add(Me.rdoDate)
        Me.Panel3.Controls.Add(Me.rdoNumber)
        Me.Panel3.Location = New System.Drawing.Point(86, 23)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(86, 64)
        Me.Panel3.TabIndex = 2
        Me.Panel3.TabStop = True
        '
        'rdoDate
        '
        Me.rdoDate.Location = New System.Drawing.Point(8, 32)
        Me.rdoDate.Name = "rdoDate"
        Me.rdoDate.Size = New System.Drawing.Size(56, 24)
        Me.rdoDate.TabIndex = 1
        Me.rdoDate.TabStop = True
        Me.rdoDate.Text = "Date"
        '
        'rdoNumber
        '
        Me.rdoNumber.Location = New System.Drawing.Point(8, 8)
        Me.rdoNumber.Name = "rdoNumber"
        Me.rdoNumber.Size = New System.Drawing.Size(72, 24)
        Me.rdoNumber.TabIndex = 0
        Me.rdoNumber.TabStop = True
        Me.rdoNumber.Text = "Number"
        '
        'Label4
        '
        Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label4.Location = New System.Drawing.Point(12, 23)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(88, 23)
        Me.Label4.TabIndex = 1
        Me.Label4.Text = "Format Version"
        '
        'Label3
        '
        Me.Label3.Dock = System.Windows.Forms.DockStyle.Top
        Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(0, 0)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(372, 23)
        Me.Label3.TabIndex = 0
        Me.Label3.Text = "Format Modifiers (optional)"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.TopCenter
        '
        'cboxFormat
        '
        Me.cboxFormat.Items.AddRange(New Object() {"", "ARCE      ARC/INFO Export format", "ARCG      ARC/INFO Generate format", "ASCII       ASCII file, formatted for text attributes, declared format", "BIL           Imagery, band interleaved by line", "BIP           Imagery, band interleaved by pixel", "BSQ         Imagery, band interleaved sequential", "CDG        Common Data Format", "CFF         Cartographic Feature File (USDA Forest Service)", "COORD   User-created coordinate file, declared format", "DBF         dBASE data file", "DEM        Digital Elevation Model format (US Geological Survey)", "DFAD       Digital Feature Analysis Data (NIMA)", "DGN        Microstation format (Intergraph Corporation)", "DIF           VisiCalc format", "DIGEST   Digital Geographic Information Exchange Standard", "DLG         Digital Line Graph (USDI Geological Survey)", "DOC         Microsoft Word file", "DTED       Digital Terrain Elevation Data (MIL-D-89020)", "DWG        AutoCAD Drawing format", "DX90        Data Exchange '90", "DXF         AutoCAD Drawing Exchange Format", "EPS         Encapsulated Postscript", "ERDAS    ERDAS image file (ERDAS Corporation)", "FW           Framework spreadsheet or database format", "GIF           Graphics Interchange Format", "GRA         ARC/INFO graphic file", "GRASS    Geographic Resources Analysis Support System", "HDF         Hierarchical Data Format", "IGDS        Interactive Graphic Design System format (Intergraph)", "IGES        Initial Graphics Exchange Standard", "MDB        Microsoft Access data file", "MOSS      Multiple Overlay Statistical System export file", "netCDF    network Common Data Format", "NITF        National Imagery Transfer Format", "PBM        Portable Bit Map format file", "PLT         ARC/INFO Plot file", "PS           Postscript", "QP           Quattro Pro data file", "RPD        Rapid file", "RPF         Raster Product Format (NIMA)", "RVC         Raster Vector Converted format (MicroImages)", "RVF         Raster Vector Format (MicroImages)", "SDTS      Spatial Data Transfer Standard (FIPS 173)", "SIF           Standard Interchange Format (DOD Project 2851)", "SPLUS    S-Plus file", "TIFF         Tagged Image File Format", "TGRLN    TIGER Line format (Bureau of the Census)", "VPF          Vector Product Format (NIMA)", "WK1        LOTUS 1-2-3 file", "WKS        LOTUS 1-2-3 file", "XLS          Microsoft Excel worksheet", "XML         XML file"})
        Me.cboxFormat.Location = New System.Drawing.Point(64, 29)
        Me.cboxFormat.Name = "cboxFormat"
        Me.cboxFormat.Size = New System.Drawing.Size(328, 21)
        Me.cboxFormat.TabIndex = 2
        Me.ToolTip1.SetToolTip(Me.cboxFormat, "the name of the data transfer format. " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "type format name if not present in list")
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(12, 32)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(56, 23)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "Format"
        Me.ToolTip1.SetToolTip(Me.Label2, "the name of the data transfer format. ")
        '
        'Label1
        '
        Me.Label1.Dock = System.Windows.Forms.DockStyle.Top
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(0, 0)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(621, 23)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Digital Transfer Information"
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopCenter
        Me.ToolTip1.SetToolTip(Me.Label1, "description of the form of the data to be distributed. ")
        '
        'ToolTip1
        '
        Me.ToolTip1.IsBalloon = True
        Me.ToolTip1.ShowAlways = True
        Me.ToolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
        '
        'frmDigitalForm
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(621, 458)
        Me.ControlBox = False
        Me.Controls.Add(Me.Panel1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmDigitalForm"
        Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Digital Form"
        Me.Panel1.ResumeLayout(False)
        Me.Panel1.PerformLayout()
        CType(Me.numSize, System.ComponentModel.ISupportInitialize).EndInit()
        Me.Panel2.ResumeLayout(False)
        Me.Panel2.PerformLayout()
        Me.pnlDate.ResumeLayout(False)
        CType(Me.numYear, System.ComponentModel.ISupportInitialize).EndInit()
        Me.pnlNumber.ResumeLayout(False)
        Me.pnlNumber.PerformLayout()
        Me.Panel3.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub frmDigitalForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strDate As String = ""
        Dim intDate As Integer = 0
        Dim strYr As String = ""
        Dim strMth As String = ""
        Dim strMthCount As String = ""
        Dim strDay As String = ""
        Dim iCount As Integer = 0
        Dim iLoop As Integer = 0  ' loop counter

        'get Digital Form to create/edit
        If (iDigitIndex <= 0) Then
            oDigiForm = New DigitalOrderClass
        Else
            oDigiForm = CType(frmMain.f61.getDigitalForm()(iDigitIndex), DigitalOrderClass)
        End If

        'set Format Name
        iCount = cboxFormat.FindString(oDigiForm.FormatName)
        If (iCount = -1) Then
            'format name is not present in list
            If (oDigiForm.FormatName = "") Then
                cboxFormat.SelectedIndex = -1
            Else
                cboxFormat.Items.Add(oDigiForm.FormatName) 'add to list
                cboxFormat.SelectedIndex = cboxFormat.Items.Count - 1 '0-based list, select new value
            End If
        Else
            cboxFormat.SelectedIndex = iCount
        End If

        'set Version information
        'find current year, convert to decimal and initialize the Year numeric box
        Dim dtYear As Date = Now
        Dim strCurYear As String = dtYear.ToString("yyyy")
        dYear = CType(strCurYear, Decimal)
        numYear.Value = dYear

        rdoNumber.Checked = False 'default values
        rdoDate.Checked = False
        pnlNumber.Enabled = False
        pnlDate.Enabled = False
        If (oDigiForm.FormatVNum <> "") Then
            rdoNumber.Checked = True
            pnlNumber.Enabled = True
            txtVerNum.Text = oDigiForm.FormatVNum
        End If
        If (oDigiForm.FormatVDate <> "") Then
            rdoDate.Checked = True
            pnlDate.Enabled = True
            'set the Version Date control
            strDate = oDigiForm.FormatVDate
            intDate = Len(strDate)
            strYr = Microsoft.VisualBasic.Left(strDate, 4) 'set Year numeric value
            If (intDate > 3) Then
                numYear.Value = CType(strYr, Decimal)
            End If
            If (intDate > 4) Then  ' set Month combo box if known 
                strMth = Mid(strDate, 5, 2)
                iCount = cboxMonth.FindString(strMth)
                cboxMonth.SelectedIndex = iCount
            End If
            If (intDate > 6) Then  ' set Day combo box if known
                strDay = Mid(strDate, 7, 2)
                cboxDay.SelectedItem = strDay
            End If
        End If

        'set Format Specification
        If (oDigiForm.FormatSpec <> "") Then
            txtSpec.Text = oDigiForm.FormatSpec
        End If

        'set ASCII file structure
        If (oDigiForm.ASCIIstruct = True) Then
            txtASCII.Text = "# headers: " & oDigiForm.NumHeaders & "  Orientation: " & oDigiForm.Orientation
        End If

        'set Format Information Content
        If (oDigiForm.FormatInfo <> "") Then
            txtInfoContent.Text = oDigiForm.FormatInfo
        End If

        'set File Decompression Technique
        If (oDigiForm.Decompress <> "") Then
            txtDecompress.Text = oDigiForm.Decompress
        End If

        'set Transfer Size
        If (oDigiForm.TransferSize <> "") Then
            numSize.Value = Convert.ToDecimal(oDigiForm.TransferSize)
        End If

        'populate Digital Transfer Options list box
        cToptions = oDigiForm.TransOptions 'collection of index values
        Dim oTrans As New DTransOption
        Dim iValue As Integer = 0
        Dim s1 As String = ""
        iCount = cToptions.Count
        For iLoop = 1 To iCount
            iValue = CType(cToptions(iLoop), Integer)
            oTrans = CType(frmMain.f61.getDTransOpt()(iValue), DTransOption)
            If (oTrans.boolOffline = True) Then
                s1 = "Offline media: " & oTrans.OfflineMedia
                lboxTransfer.Items.Add(s1)
            End If
            If (oTrans.boolOnline = True) Then
                s1 = "Online network address: " & oTrans.NetworkName
                lboxTransfer.Items.Add(s1)
            End If
        Next

    End Sub

    Private Sub rdoNumber_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoNumber.CheckedChanged
        If (rdoNumber.Checked = True) Then
            pnlNumber.Enabled = True
            txtVerNum.Text = ""
        Else
            pnlNumber.Enabled = False
            txtVerNum.Text = ""
        End If
    End Sub

    Private Sub rdoDate_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoDate.CheckedChanged
        If (rdoDate.Checked = True) Then
            pnlDate.Enabled = True
            numYear.Value = dYear
            cboxMonth.SelectedIndex = -1
            cboxDay.SelectedIndex = -1
        Else
            pnlDate.Enabled = False
            numYear.Value = dYear
            cboxMonth.SelectedIndex = -1
            cboxDay.SelectedIndex = -1
        End If
    End Sub

    Private Sub btnEditASCII_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEditASCII.Click
        Dim editASCII As New frmASCII(oDigiForm)
        editASCII.ShowDialog()
        If (editASCII.getUpdated() = True) Then
            oDigiForm = editASCII.getDigiForm() 'update the Digital Form object
            If (oDigiForm.ASCIIstruct = True) Then
                txtASCII.Text = "# headers: " & oDigiForm.NumHeaders & "  Orientation: " & oDigiForm.Orientation
            Else
                txtASCII.Text = ""
            End If
        End If
    End Sub

    Private Sub btnAddOption_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddOption.Click
        Dim s1 As String = ""
        Dim indexVal As Integer = 0
        Dim newDigiOption As New frmTransOpts(indexVal)
        newDigiOption.ShowDialog()
        If (newDigiOption.getUpdated() = True) Then
            frmMain.f61.addDTransOpt(newDigiOption.getDTrans()) 'add new Digital Transfer Option to collection
            indexVal = frmMain.f61.getDTransOpt().Count 'get updated count of Options = last index value
            cToptions.Add(indexVal) 'add index value to index value collection
            If (newDigiOption.getDTrans().boolOnline = True) Then
                s1 = "Online: Network name = " & Microsoft.VisualBasic.Left(newDigiOption.getDTrans().NetworkName, 50)
            Else
                s1 = "Offline: Media type = " & newDigiOption.getDTrans().OfflineMedia
            End If
            lboxTransfer.Items.Add(s1)
        End If
    End Sub

    Private Sub btnEditOption_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEditOption.Click
        Dim s1 As String = ""
        Dim iVal As Integer = lboxTransfer.SelectedIndex
        Dim iCount As Integer = lboxTransfer.Items.Count
        If (iVal = -1) Then
            If (iCount = 0) Then
                s1 = "No Transfer Option available for editing"
                MessageBox.Show(s1, "Selection error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Return
            ElseIf (iCount = 1) Then
                iVal = 0 'default to editing 1st entry when only 1 present
            Else
                s1 = "No Transfer Option selected for editing"
                MessageBox.Show(s1, "Selection error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Return
            End If
        End If

        iCount = CType(cToptions(iVal + 1), Integer) 'retrieve Digital Transfer Option index value after convert to 1-based
        Dim editDigiOption As New frmTransOpts(iCount)
        editDigiOption.ShowDialog()
        If (editDigiOption.getUpdated() = True) Then
            frmMain.f61.addDTransOpt(editDigiOption.getDTrans(), iCount) 'insert edited Digital Transfer Option into collection
            frmMain.f61.removeDTransOpt(iCount + 1) 'remove old version; 1-based collection
            'index value collection does not require updating
            If (editDigiOption.getDTrans().boolOnline = True) Then
                s1 = "Online: Network name = " & Microsoft.VisualBasic.Left(editDigiOption.getDTrans().NetworkName, 50)
            Else
                s1 = "Offline: Media type = " & editDigiOption.getDTrans().OfflineMedia
            End If
            lboxTransfer.Items.Insert(iVal, s1) 'put edited entry into list box; 0-based collection
            lboxTransfer.Items.RemoveAt(iVal + 1) 'remove old entry
        End If
        btnEditOption.Enabled = False : btnDelOption.Enabled = False
    End Sub

    Private Sub btnDelOption_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelOption.Click
        Dim s1 As String = ""
        Dim iVal As Integer = lboxTransfer.SelectedIndex
        If (iVal = -1) Then
            s1 = "No Transfer Option selected for deletion"
            MessageBox.Show(s1, "Selection error", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Return
        Else
            cToptions.Remove(iVal + 1) '1-based collection
            lboxTransfer.Items.RemoveAt(iVal) '0-based collection
            'notice that we have NOT removed any items from the main cDTransOpt collection
            'this maintains the coherence of all the other index collections without additional updating
        End If
        btnEditOption.Enabled = False : btnDelOption.Enabled = False
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Dim iCount As Integer = cToptions.Count
        Dim s1 As String = ""
        If (cboxFormat.Text = "") Then
            s1 = "No Format Name provided"
            MessageBox.Show(s1, "Insufficient information", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Return
        End If
        If (iCount = 0) Then
            s1 = "At least 1 Digital Transfer Option required"
            MessageBox.Show(s1, "Insufficient information", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Return
        End If

        Dim sGenArray() As String
        Dim sYr As String = ""
        Dim sMonth As String = ""
        Dim sTime As String = ""
        Dim sDay As String = ""

        'ready to update the Digital Form object
        sGenArray = Split(cboxFormat.Text) 'splits based on space character -- no spaces in format abbreviations
        s1 = sGenArray(0) 'the format abbreviation
        With oDigiForm
            .FormatName = s1
            If (rdoNumber.Checked = True) Then
                .FormatVNum = txtVerNum.Text
            End If
            If (rdoDate.Checked = True) Then
                sYr = numYear.Value.ToString
                s1 = CType(cboxMonth.SelectedItem, String)
                sMonth = Microsoft.VisualBasic.Left(s1, 2)
                If (sMonth = "00") Then
                    sMonth = ""
                End If
                sDay = CType(cboxDay.SelectedItem, String)
                If (sDay = "00") Then
                    sDay = ""
                End If
                sYr = sYr & sMonth & sDay
                .FormatVDate = sYr
            End If
            .FormatSpec = txtSpec.Text
            If (.FormatSpec <> "") Then
                If (.FormatVNum = "" And .FormatVDate = "") Then
                    .FormatVNum = "see Format Specification"
                End If
            End If
            'ASCII File Structure already in updated state
            .FormatInfo = txtInfoContent.Text
            .Decompress = txtDecompress.Text
            If (numSize.Value = 0.0) Then
                .TransferSize = ""
            Else
                .TransferSize = numSize.Value.ToString
            End If
            .TransOptions = cToptions
        End With
        bUpdate = True  'Digital Form has changed
        Me.Close()
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        bUpdate = False
        Me.Close()
    End Sub

    Private Sub lboxTransfer_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lboxTransfer.SelectedIndexChanged
        If lboxTransfer.SelectedItems.Count() > 0 Then btnEditOption.Enabled = True : btnDelOption.Enabled = True Else btnEditOption.Enabled = False : btnDelOption.Enabled = False
    End Sub

    Public Function getUpdated() As Boolean
        Return bUpdate
    End Function

    Public Function getDigiForm() As DigitalOrderClass
        Return oDigiForm
    End Function

    Private Sub button_example_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_example.Click
        Dim helpForm As dialog_help = New dialog_help("DigitalForm")
        helpForm.ShowDialog()
    End Sub
End Class
